package durose.system.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import durose.system.mapper.BossMapper;
import durose.system.pojo.Boss;
import durose.system.pojo.BossExample;
import durose.system.service.BossService;

@Service
public class BossServiceImpl implements BossService {
	@Autowired
	BossMapper mapper;
	
	@Override
	public int bossAdd(Boss pojo) {
		return mapper.insert(pojo);
	}

	@Override
	public void bossDelete(int id) {
		mapper.deleteByPrimaryKey(id);
	}

	@Override
	public void bossUpdate(Boss pojo) {
		mapper.updateByPrimaryKey(pojo);
	}

	@Override
	public Boss bossGet(int id) {
		return mapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Boss> bossList(String queryName) {
		BossExample example = new BossExample();
		example.createCriteria().andBoss_nameLike('%'+queryName+'%');
		return mapper.selectByExample(example);
	}
}
